//
//  MainTwoTableViewCell.m
//  B项目
//
//  Created by lanou on 15/12/25.
//  Copyright © 2015年 tzf. All rights reserved.
//

#import "MainTwoTableViewCell.h"
#import "MainClassDetail.h"

@implementation MainTwoTableViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        _pictureView = [[UIImageView alloc]initWithFrame:CGRectMake(10, 5, kWidth - 20, 160)];
        [self.contentView addSubview:_pictureView];
        
        UIImageView *imagev = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 60, 60)];
        imagev.image = [UIImage imageNamed:@"1128280.gif"];
        [self.pictureView addSubview:imagev];
        
        _titleLable = [[UILabel alloc] initWithFrame:CGRectMake(10, 140, kWidth - 20, 25)];
        _titleLable.textAlignment = NSTextAlignmentCenter;
        _titleLable.textColor = [UIColor whiteColor];
        _titleLable.font = [UIFont systemFontOfSize:16];
        //        _titleLable.backgroundColor = [UIColor grayColor];
        //        _titleLable.alpha = 0.1;
        UIView *view = [[UIView alloc] initWithFrame:CGRectMake(10, 140, kWidth - 20, 25)];
        view.backgroundColor = [UIColor darkGrayColor];
        view.alpha = 0.4;
        view.layer.cornerRadius = 5;
        view.layer.masksToBounds = YES;
        
        [self.contentView addSubview:view];
        
        //        self.backgroundColor = [UIColor whiteColor];
        
        [self.contentView addSubview:_titleLable];
    }
    return self;
}

- (void)setMainDetail:(MainClassDetail *)mainDetail
{
    if (_mainDetail != mainDetail) {
        _mainDetail = mainDetail;
    }
    _pictureView.image = [UIImage imageNamed:@"zhanweipic.png"];
    [_pictureView sd_setImageWithURL:[NSURL URLWithString:mainDetail.cover_image_url]];
    _pictureView.layer.cornerRadius = 5;
    _pictureView.layer.masksToBounds = YES;
    _titleLable.text = mainDetail.title;
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
